package com.jd.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @program: MyTank
 * @description:
 * @author: 王术平
 * @create: 2021-01-04 00:40
 **/
public class PropertyMgr {
    private static final PropertyMgr INSTANCE = new PropertyMgr();

    private PropertyMgr() {
    }

    public static PropertyMgr getPropertyMgr() {
        return INSTANCE;
    }

    private static Properties props = new Properties();

    static {
        try {
            props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key) {
        if (props == null) return null;
        return props.get(key);
    }
}
